package mscs.data;

import java.io.File;
import java.util.List;
import mscs.data.pojo.Operation;


public class IOperationProxy implements IFileDataStore {
	private String fileName = "operation.txt";
	IFileDataStore fds;
	public IOperationProxy() {
		this.fds = new FileDataStore(Operation.class, new File(fileName));
	}
        public IOperationProxy(String fileName) {
                this.fileName = fileName;
                this.fds = new FileDataStore(Operation.class, new File(fileName));
	}
	@Override
	public List getObjects() {
		return fds.getObjects();
	}

	@Override
	public void update(List list) {
		fds.update(list);
	}

	@Override
	public void add(List list) {
		fds.add(list);
	}

	@Override
	public List getObjectsByAttr(String key, String value) {
		return fds.getObjectsByAttr(key, value);
	}

	@Override
	public List searchObjectsByAttr(String key, String regexp) {
		return fds.searchObjectsByAttr(key, regexp);
	}

	@Override
	public void deleteByIndex(int[] index) {
		fds.deleteByIndex(index);
	}

}
